package rules;

import com.ruoyi.system.domain.vo.SysDangerPointVO;

<#list SysDangerPointVOList as item >
    <#if item.lowAndLow != -1>
        rule "${item.databaseBitNumber}ddd"
            when
                $s : SysDangerPointVO(av < ${item.lowAndLow} && databaseBitNumber == ${item.databaseBitNumber})
            then
                $s.setAlert(1);
                $s.setAlertType("低低低报");
                update($s);
        end
    </#if>
    <#if item.playItLow != -1>
        rule "${item.databaseBitNumber}dd"
            when
                $s : SysDangerPointVO(av < ${item.playItLow} && ${item.lowAndLow} < av && databaseBitNumber == ${item.databaseBitNumber})
            then
                $s.setAlert(1);
                $s.setAlertType("低低报");
                update($s);
        end
    </#if>
    <#if item.lowQuota != -1>
        rule "${item.databaseBitNumber}d"
            when
                $s : SysDangerPointVO(av < ${item.lowQuota} && ${item.playItLow} < av && ${item.lowAndLow} < av && databaseBitNumber == ${item.databaseBitNumber})
            then
                $s.setAlert(1);
                $s.setAlertType("低报");
                update($s);
        end
    </#if>
    <#if item.highQuota != -1>
        rule "${item.databaseBitNumber}g"
            when
                $s : SysDangerPointVO(av > ${item.highQuota} && av < ${item.highAndMighty} && databaseBitNumber == ${item.databaseBitNumber})
            then
                $s.setAlert(1);
                $s.setAlertType("高报");
                update($s);
        end
    </#if>
    <#if item.highAndMighty != -1>
        rule "${item.databaseBitNumber}gg"
            when
                $s : SysDangerPointVO(av > ${item.highAndMighty} && databaseBitNumber == ${item.databaseBitNumber})
            then
                $s.setAlert(1);
                $s.setAlertType("高高报");
                update($s);
        end
    </#if>
</#list>
